package com.newsmanagement.controller;

import com.alibaba.fastjson.JSONObject;
import com.newsmanagement.model.User;
import com.newsmanagement.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by xiaopeng on 2017/7/31.
 */

@CrossOrigin
@RestController
@RequestMapping(value = "/user")
public class UserController {

     @Autowired
     UserService userService;


     @RequestMapping(value = "/getUserInfo" ,method ={RequestMethod.GET, RequestMethod.POST})
     public JSONObject getUserInfo(@RequestParam Long uid){
         User userInfo=  userService.getUserInfo();
          JSONObject data = new JSONObject();
          data.put("data",userInfo);
         return  data;
     }


}
